package com.server.system.controller.feignController;

import com.server.common.code.utils.Result;
import com.server.model.all.enums.SystemEnum;
import com.server.common.code.utils.ResultUtil;
import com.server.system.service.BlackWhiteListService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 黑白名单
 * @author LXC
 * @date 2022/5/5 13:16
 */
@RestController
@RequestMapping(path = "/blackWhiteList/private")
public class FeignBlackWhiteListController {

    @Resource
    private BlackWhiteListService blackWhiteListService;

    /**
     * 获取IP地址黑白名单
     * @author LXC
     * @date 2023/2/4 9:19
     */
    @PostMapping("/getBlackWhiteIpAddr")
    public Result<List<String>> getBlackWhiteIpAddr(@RequestParam("state") Integer state){
        return ResultUtil.successData(blackWhiteListService.getBlackWhiteIpAddr(SystemEnum.blackWhiteListStateEnum.getBlackWhiteListStateEnum(state)));
    }

}
